rust-bindings: Regenerate with updated gir
authorColin Walters <walters@verbum.org>
Fri, 18 Jul 2025 19:11:15 +0000 (15:11 -0400)
committerColin Walters <walters@verbum.org>
Fri, 18 Jul 2025 19:11:15 +0000 (15:11 -0400)
In particular we had a conflict as the previous bindings
were generated with an old version of the C APIs.

rust-bindings/Makefile
rust-bindings/src/auto/bootconfig_parser.rs
rust-bindings/src/auto/deployment.rs
rust-bindings/src/auto/repo.rs
rust-bindings/src/auto/sysroot.rs
rust-bindings/src/auto/versions.txt
rust-bindings/sys/src/auto/versions.txt
rust-bindings/sys/src/lib.rs

index 87fc32abcf4d97305a67443ee3de46f4f6960444..e86440242470011da92d0b301048e398a39881ba 100644 (file)
@@ -1,5 +1,5 @@
 GIR_REPO := https://github.com/gtk-rs/gir.git
-GIR_VERSION := 5433e2582f831d551789ee95fa04188d2a5fd3e5 # 0.20.4
+GIR_VERSION := 19ccbbc9a3d1cc9271b7a5fa5d84b5652ee99492 # 0.21.0
 GIR_FILES_VERSION := 0.20.0
 OSTREE_REPO := ../ostree
 OSTREE_VERSION := patch-v2022.2
index 06f7539fd69fcfcd2e31961024b72b8aab791644..9f7a1595d809acb90311d65a95f20b6ebb0f2fb3 100644 (file)
@@ -47,6 +47,24 @@ impl BootconfigParser {
         }
     }
 
+    #[doc(alias = "ostree_bootconfig_parser_get_tries_done")]
+    #[doc(alias = "get_tries_done")]
+    pub fn tries_done(&self) -> u64 {
+        unsafe {
+            ffi::ostree_bootconfig_parser_get_tries_done(self.to_glib_none().0)
+        }
+    }
+
+    #[cfg(feature = "v2025_2")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "v2025_2")))]
+    #[doc(alias = "ostree_bootconfig_parser_get_tries_left")]
+    #[doc(alias = "get_tries_left")]
+    pub fn tries_left(&self) -> u64 {
+        unsafe {
+            ffi::ostree_bootconfig_parser_get_tries_left(self.to_glib_none().0)
+        }
+    }
+
     #[doc(alias = "ostree_bootconfig_parser_parse")]
     pub fn parse(&self, path: &impl IsA<gio::File>, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
         unsafe {
index 756e782dd1ed57a7abb4baf4b502d83be451309b..6a8cb11f135993860dbe2afee37d14189e2cef5f 100644 (file)
@@ -2,11 +2,11 @@
 // from gir-files
 // DO NOT EDIT
 
+use crate::{ffi,BootconfigParser};
 #[cfg(feature = "v2016_4")]
 #[cfg_attr(docsrs, doc(cfg(feature = "v2016_4")))]
-use crate::DeploymentUnlockedState;
-use crate::{ffi, BootconfigParser};
-use glib::translate::*;
+use crate::{DeploymentUnlockedState};
+use glib::{translate::*};
 
 glib::wrapper! {
     #[doc(alias = "OstreeDeployment")]
@@ -19,100 +19,97 @@ glib::wrapper! {
 
 impl Deployment {
     #[doc(alias = "ostree_deployment_new")]
-    pub fn new(
-        index: i32,
-        osname: &str,
-        csum: &str,
-        deployserial: i32,
-        bootcsum: Option<&str>,
-        bootserial: i32,
-    ) -> Deployment {
-        unsafe {
-            from_glib_full(ffi::ostree_deployment_new(
-                index,
-                osname.to_glib_none().0,
-                csum.to_glib_none().0,
-                deployserial,
-                bootcsum.to_glib_none().0,
-                bootserial,
-            ))
+    pub fn new(index: i32, osname: &str, csum: &str, deployserial: i32, bootcsum: Option<&str>, bootserial: i32) -> Deployment {
+        unsafe {
+            from_glib_full(ffi::ostree_deployment_new(index, osname.to_glib_none().0, csum.to_glib_none().0, deployserial, bootcsum.to_glib_none().0, bootserial))
         }
     }
 
     #[doc(alias = "ostree_deployment_clone")]
-    #[must_use]
+#[must_use]
     pub fn clone(&self) -> Deployment {
-        unsafe { from_glib_full(ffi::ostree_deployment_clone(self.to_glib_none().0)) }
+        unsafe {
+            from_glib_full(ffi::ostree_deployment_clone(self.to_glib_none().0))
+        }
     }
 
     #[doc(alias = "ostree_deployment_equal")]
     pub fn equal(&self, bp: &Deployment) -> bool {
         unsafe {
-            from_glib(ffi::ostree_deployment_equal(
-                ToGlibPtr::<*mut ffi::OstreeDeployment>::to_glib_none(self).0
-                    as glib::ffi::gconstpointer,
-                ToGlibPtr::<*mut ffi::OstreeDeployment>::to_glib_none(bp).0
-                    as glib::ffi::gconstpointer,
-            ))
+            from_glib(ffi::ostree_deployment_equal(ToGlibPtr::<*mut ffi::OstreeDeployment>::to_glib_none(self).0 as glib::ffi::gconstpointer, ToGlibPtr::<*mut ffi::OstreeDeployment>::to_glib_none(bp).0 as glib::ffi::gconstpointer))
         }
     }
 
     #[doc(alias = "ostree_deployment_get_bootconfig")]
     #[doc(alias = "get_bootconfig")]
     pub fn bootconfig(&self) -> Option<BootconfigParser> {
-        unsafe { from_glib_none(ffi::ostree_deployment_get_bootconfig(self.to_glib_none().0)) }
+        unsafe {
+            from_glib_none(ffi::ostree_deployment_get_bootconfig(self.to_glib_none().0))
+        }
     }
 
     #[doc(alias = "ostree_deployment_get_bootcsum")]
     #[doc(alias = "get_bootcsum")]
     pub fn bootcsum(&self) -> glib::GString {
-        unsafe { from_glib_none(ffi::ostree_deployment_get_bootcsum(self.to_glib_none().0)) }
+        unsafe {
+            from_glib_none(ffi::ostree_deployment_get_bootcsum(self.to_glib_none().0))
+        }
     }
 
     #[doc(alias = "ostree_deployment_get_bootserial")]
     #[doc(alias = "get_bootserial")]
     pub fn bootserial(&self) -> i32 {
-        unsafe { ffi::ostree_deployment_get_bootserial(self.to_glib_none().0) }
+        unsafe {
+            ffi::ostree_deployment_get_bootserial(self.to_glib_none().0)
+        }
     }
 
     #[doc(alias = "ostree_deployment_get_csum")]
     #[doc(alias = "get_csum")]
     pub fn csum(&self) -> glib::GString {
-        unsafe { from_glib_none(ffi::ostree_deployment_get_csum(self.to_glib_none().0)) }
+        unsafe {
+            from_glib_none(ffi::ostree_deployment_get_csum(self.to_glib_none().0))
+        }
     }
 
     #[doc(alias = "ostree_deployment_get_deployserial")]
     #[doc(alias = "get_deployserial")]
     pub fn deployserial(&self) -> i32 {
-        unsafe { ffi::ostree_deployment_get_deployserial(self.to_glib_none().0) }
+        unsafe {
+            ffi::ostree_deployment_get_deployserial(self.to_glib_none().0)
+        }
     }
 
     #[doc(alias = "ostree_deployment_get_index")]
     #[doc(alias = "get_index")]
     pub fn index(&self) -> i32 {
-        unsafe { ffi::ostree_deployment_get_index(self.to_glib_none().0) }
+        unsafe {
+            ffi::ostree_deployment_get_index(self.to_glib_none().0)
+        }
     }
 
     #[doc(alias = "ostree_deployment_get_origin")]
     #[doc(alias = "get_origin")]
     pub fn origin(&self) -> Option<glib::KeyFile> {
-        unsafe { from_glib_none(ffi::ostree_deployment_get_origin(self.to_glib_none().0)) }
+        unsafe {
+            from_glib_none(ffi::ostree_deployment_get_origin(self.to_glib_none().0))
+        }
     }
 
     #[doc(alias = "ostree_deployment_get_origin_relpath")]
     #[doc(alias = "get_origin_relpath")]
     pub fn origin_relpath(&self) -> glib::GString {
         unsafe {
-            from_glib_full(ffi::ostree_deployment_get_origin_relpath(
-                self.to_glib_none().0,
-            ))
+            from_glib_full(ffi::ostree_deployment_get_origin_relpath(self.to_glib_none().0))
         }
     }
 
     #[doc(alias = "ostree_deployment_get_osname")]
     #[doc(alias = "get_osname")]
     pub fn osname(&self) -> glib::GString {
-        unsafe { from_glib_none(ffi::ostree_deployment_get_osname(self.to_glib_none().0)) }
+        unsafe {
+            from_glib_none(ffi::ostree_deployment_get_osname(self.to_glib_none().0))
+        }
     }
 
     #[cfg(feature = "v2016_4")]
@@ -120,16 +117,15 @@ impl Deployment {
     #[doc(alias = "ostree_deployment_get_unlocked")]
     #[doc(alias = "get_unlocked")]
     pub fn unlocked(&self) -> DeploymentUnlockedState {
-        unsafe { from_glib(ffi::ostree_deployment_get_unlocked(self.to_glib_none().0)) }
+        unsafe {
+            from_glib(ffi::ostree_deployment_get_unlocked(self.to_glib_none().0))
+        }
     }
 
     #[doc(alias = "ostree_deployment_hash")]
     pub fn hash(&self) -> u32 {
         unsafe {
-            ffi::ostree_deployment_hash(
-                ToGlibPtr::<*mut ffi::OstreeDeployment>::to_glib_none(self).0
-                    as glib::ffi::gconstpointer,
-            )
+            ffi::ostree_deployment_hash(ToGlibPtr::<*mut ffi::OstreeDeployment>::to_glib_none(self).0 as glib::ffi::gconstpointer)
         }
     }
 
@@ -138,9 +134,7 @@ impl Deployment {
     #[doc(alias = "ostree_deployment_is_finalization_locked")]
     pub fn is_finalization_locked(&self) -> bool {
         unsafe {
-            from_glib(ffi::ostree_deployment_is_finalization_locked(
-                self.to_glib_none().0,
-            ))
+            from_glib(ffi::ostree_deployment_is_finalization_locked(self.to_glib_none().0))
         }
     }
 
@@ -148,15 +142,15 @@ impl Deployment {
     #[cfg_attr(docsrs, doc(cfg(feature = "v2018_3")))]
     #[doc(alias = "ostree_deployment_is_pinned")]
     pub fn is_pinned(&self) -> bool {
-        unsafe { from_glib(ffi::ostree_deployment_is_pinned(self.to_glib_none().0)) }
+        unsafe {
+            from_glib(ffi::ostree_deployment_is_pinned(self.to_glib_none().0))
+        }
     }
 
     #[doc(alias = "ostree_deployment_is_soft_reboot_target")]
     pub fn is_soft_reboot_target(&self) -> bool {
         unsafe {
-            from_glib(ffi::ostree_deployment_is_soft_reboot_target(
-                self.to_glib_none().0,
-            ))
+            from_glib(ffi::ostree_deployment_is_soft_reboot_target(self.to_glib_none().0))
         }
     }
 
@@ -164,16 +158,15 @@ impl Deployment {
     #[cfg_attr(docsrs, doc(cfg(feature = "v2018_3")))]
     #[doc(alias = "ostree_deployment_is_staged")]
     pub fn is_staged(&self) -> bool {
-        unsafe { from_glib(ffi::ostree_deployment_is_staged(self.to_glib_none().0)) }
+        unsafe {
+            from_glib(ffi::ostree_deployment_is_staged(self.to_glib_none().0))
+        }
     }
 
     #[doc(alias = "ostree_deployment_set_bootconfig")]
     pub fn set_bootconfig(&self, bootconfig: Option<&BootconfigParser>) {
         unsafe {
-            ffi::ostree_deployment_set_bootconfig(
-                self.to_glib_none().0,
-                bootconfig.to_glib_none().0,
-            );
+            ffi::ostree_deployment_set_bootconfig(self.to_glib_none().0, bootconfig.to_glib_none().0);
         }
     }
 
@@ -212,9 +205,7 @@ impl Deployment {
     #[doc(alias = "ostree_deployment_unlocked_state_to_string")]
     pub fn unlocked_state_to_string(state: DeploymentUnlockedState) -> glib::GString {
         unsafe {
-            from_glib_none(ffi::ostree_deployment_unlocked_state_to_string(
-                state.into_glib(),
-            ))
+            from_glib_none(ffi::ostree_deployment_unlocked_state_to_string(state.into_glib()))
         }
     }
 }
index c886343959969c8a6f03eae6bfcf65f310944ec7..78b90b6b1ac956975d20221ec1e578f2fada0730 100644 (file)
@@ -1207,6 +1207,16 @@ impl Repo {
         }
     }
 
+    #[doc(alias = "ostree_repo_write_config_and_reload")]
+    pub fn write_config_and_reload(&self, new_config: &glib::KeyFile) -> Result<(), glib::Error> {
+        unsafe {
+            let mut error = std::ptr::null_mut();
+            let is_ok = ffi::ostree_repo_write_config_and_reload(self.to_glib_none().0, new_config.to_glib_none().0, &mut error);
+            debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
+            if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
+        }
+    }
+
     #[doc(alias = "ostree_repo_write_content_trusted")]
     pub fn write_content_trusted(&self, checksum: &str, object_input: &impl IsA<gio::InputStream>, length: u64, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
         unsafe {
index 250b01b46752c7443d0160ddec37f79ee6179581..397d9c9b729f1621e2e999e28720ca9a2fd096cc 100644 (file)
@@ -74,6 +74,16 @@ impl Sysroot {
     //    unsafe { TODO: call ffi:ostree_sysroot_cleanup_prune_repo() }
     //}
 
+    #[doc(alias = "ostree_sysroot_clear_soft_reboot")]
+    pub fn clear_soft_reboot(&self, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
+        unsafe {
+            let mut error = std::ptr::null_mut();
+            let is_ok = ffi::ostree_sysroot_clear_soft_reboot(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
+            debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
+            if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
+        }
+    }
+
     #[cfg(feature = "v2018_5")]
     #[cfg_attr(docsrs, doc(cfg(feature = "v2018_5")))]
     #[doc(alias = "ostree_sysroot_deploy_tree")]
@@ -119,16 +129,6 @@ impl Sysroot {
         }
     }
 
-    #[doc(alias = "ostree_sysroot_deployment_prepare_next_root")]
-    pub fn deployment_prepare_next_root(&self, deployment: &Deployment, allow_kernel_skew: bool, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
-        unsafe {
-            let mut error = std::ptr::null_mut();
-            let is_ok = ffi::ostree_sysroot_deployment_prepare_next_root(self.to_glib_none().0, deployment.to_glib_none().0, allow_kernel_skew.into_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
-            debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
-            if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
-        }
-    }
-
     #[doc(alias = "ostree_sysroot_deployment_set_kargs")]
     pub fn deployment_set_kargs(&self, deployment: &Deployment, new_kargs: &[&str], cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
         unsafe {
@@ -171,6 +171,16 @@ impl Sysroot {
         }
     }
 
+    #[doc(alias = "ostree_sysroot_deployment_set_soft_reboot")]
+    pub fn deployment_set_soft_reboot(&self, deployment: &Deployment, allow_kernel_skew: bool, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
+        unsafe {
+            let mut error = std::ptr::null_mut();
+            let is_ok = ffi::ostree_sysroot_deployment_set_soft_reboot(self.to_glib_none().0, deployment.to_glib_none().0, allow_kernel_skew.into_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
+            debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
+            if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
+        }
+    }
+
     #[cfg(feature = "v2016_4")]
     #[cfg_attr(docsrs, doc(cfg(feature = "v2016_4")))]
     #[doc(alias = "ostree_sysroot_deployment_unlock")]
@@ -369,7 +379,7 @@ impl Sysroot {
         let user_data: Box_<glib::thread_guard::ThreadGuard<P>> = Box_::new(glib::thread_guard::ThreadGuard::new(callback));
         unsafe extern "C" fn lock_async_trampoline<P: FnOnce(Result<(), glib::Error>) + 'static>(_source_object: *mut glib::gobject_ffi::GObject, res: *mut gio::ffi::GAsyncResult, user_data: glib::ffi::gpointer) {
             let mut error = std::ptr::null_mut();
-            let _ = ffi::ostree_sysroot_lock_finish(_source_object as *mut _, res, &mut error);
+            ffi::ostree_sysroot_lock_finish(_source_object as *mut _, res, &mut error);
             let result = if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) };
             let callback: Box_<glib::thread_guard::ThreadGuard<P>> = Box_::from_raw(user_data as *mut _);
             let callback: P = callback.into_inner();
index 00a536578480dd87e83eca01a4eb6bbef152c23d..8df17db5aa3b90461e0211c289fc3a11609e5f24 100644 (file)
@@ -1,2 +1,2 @@
-Generated by gir (https://github.com/gtk-rs/gir @ 5433e2582f83)
-from gir-files (@ 38af5498595a)
+Generated by gir (https://github.com/gtk-rs/gir @ 19ccbbc9a3d1)
+from gir-files (@ 98aa788d67af)
index 00a536578480dd87e83eca01a4eb6bbef152c23d..8df17db5aa3b90461e0211c289fc3a11609e5f24 100644 (file)
@@ -1,2 +1,2 @@
-Generated by gir (https://github.com/gtk-rs/gir @ 5433e2582f83)
-from gir-files (@ 38af5498595a)
+Generated by gir (https://github.com/gtk-rs/gir @ 19ccbbc9a3d1)
+from gir-files (@ 98aa788d67af)
index 3dadf9cfa264e9dbf152651561c77d39d61816c3..2557d1b69045f0344775181c7a8991180528f493 100644 (file)
@@ -1577,6 +1577,10 @@ extern "C" {
     pub fn ostree_bootconfig_parser_get_overlay_initrds(
         self_: *mut OstreeBootconfigParser,
     ) -> *mut *mut c_char;
+    pub fn ostree_bootconfig_parser_get_tries_done(self_: *mut OstreeBootconfigParser) -> u64;
+    #[cfg(feature = "v2025_2")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "v2025_2")))]
+    pub fn ostree_bootconfig_parser_get_tries_left(self_: *mut OstreeBootconfigParser) -> u64;
     pub fn ostree_bootconfig_parser_parse(
         self_: *mut OstreeBootconfigParser,
         path: *mut gio::GFile,
@@ -2781,6 +2785,11 @@ extern "C" {
         new_config: *mut glib::GKeyFile,
         error: *mut *mut glib::GError,
     ) -> gboolean;
+    pub fn ostree_repo_write_config_and_reload(
+        self_: *mut OstreeRepo,
+        new_config: *mut glib::GKeyFile,
+        error: *mut *mut glib::GError,
+    ) -> gboolean;
     pub fn ostree_repo_write_content(
         self_: *mut OstreeRepo,
         expected_checksum: *const c_char,
@@ -3100,6 +3109,11 @@ extern "C" {
         cancellable: *mut gio::GCancellable,
         error: *mut *mut glib::GError,
     ) -> gboolean;
+    pub fn ostree_sysroot_clear_soft_reboot(
+        self_: *mut OstreeSysroot,
+        cancellable: *mut gio::GCancellable,
+        error: *mut *mut glib::GError,
+    ) -> gboolean;
     #[cfg(feature = "v2018_5")]
     #[cfg_attr(docsrs, doc(cfg(feature = "v2018_5")))]
     pub fn ostree_sysroot_deploy_tree(
@@ -3138,13 +3152,6 @@ extern "C" {
         cancellable: *mut gio::GCancellable,
         error: *mut *mut glib::GError,
     ) -> gboolean;
-    pub fn ostree_sysroot_deployment_prepare_next_root(
-        self_: *mut OstreeSysroot,
-        deployment: *mut OstreeDeployment,
-        allow_kernel_skew: gboolean,
-        cancellable: *mut gio::GCancellable,
-        error: *mut *mut glib::GError,
-    ) -> gboolean;
     pub fn ostree_sysroot_deployment_set_kargs(
         self_: *mut OstreeSysroot,
         deployment: *mut OstreeDeployment,
@@ -3174,6 +3181,13 @@ extern "C" {
         is_pinned: gboolean,
         error: *mut *mut glib::GError,
     ) -> gboolean;
+    pub fn ostree_sysroot_deployment_set_soft_reboot(
+        self_: *mut OstreeSysroot,
+        deployment: *mut OstreeDeployment,
+        allow_kernel_skew: gboolean,
+        cancellable: *mut gio::GCancellable,
+        error: *mut *mut glib::GError,
+    ) -> gboolean;
     #[cfg(feature = "v2016_4")]
     #[cfg_attr(docsrs, doc(cfg(feature = "v2016_4")))]
     pub fn ostree_sysroot_deployment_unlock(